<?php
class Core_Data_Sessiondata {
	
	/**
	 * database handler
	 * 
	 * @var database
	 */
	public $database;
	
	public function __construct(){
		$this->database = new Core_Driver_MysqlImproved();
	}
	
	public function getUSessionData($username, $password){
		
		$this->database->connect();
		
		$username = $this->database->escape($username);
		$password = $this->database->escape($password);
		
		$this->database->prepare(
			"
				SELECT
				users_data.user_username,
				users_data.user_email,
				users_data.user_realname,
				user_settings.privilege_type,
				user_webpage.page_url
				FROM
				users_data,
				user_settings,
				user_webpage
				WHERE
				users_data.user_username = 'Administrator'
				AND
				users_data.user_password = SHA1('r3v3l@t104')
				AND
				user_settings.user_username = 'Administrator'
				AND
				user_settings.user_username = users_data.user_username
				AND 
				user_webpage.user_username = users_data.user_username
				AND
				user_webpage.user_username = 'Administrator'
				LIMIT
				1
				;
			"
		);
		
		$this->database->query();
		
		$sessionData = $this->database->fecth('array');
		
		return $sessionData;
		
	}
	
}